<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>圈速管理</title>

    <!-- Bootstrap core CSS -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <script src="/js/jquery-3.5.1.js"></script>
    <script>
        function deleteVehicle(id) {
            let flag = window.confirm("是否删除？");
            if (flag) {
                window.location = "/management/deleteVehicle?id=" + id;
            }
        }
    </script>
</head>

<body>
<!--导航栏-->
<div th:replace="~{commons/header::navbar(pageName='lapTimeManagement')}"></div>


<table class="table table-hover">
    <thead>
    <tr>
        <th>名次</th>
        <th>车辆</th>
        <th>圈速</th>
        <th class="col-md-3">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="vehicle,status:${vehicleList}">
        <th th:text="${status.count}">名次</th>
        <th><a th:text="${vehicle.getModel_name()}" th:href="@{/modelInfo(id=${vehicle.getId()})}"></a></th>
        <th th:text="${vehicle.getLap_time_str()}"></th>
        <th>
            <a type="button" class="btn btn-primary btn-sm" th:href="@{/management/updateVehicle(id=${vehicle.getId()})}">修改</a>
            <a type="button" class="btn btn-danger btn-sm"
               th:onclick="'deleteVehicle('+${vehicle.getId()}+')'">删除</a>
        </th>
    </tr>
    </tbody>
</table>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!--<script src="/js/jquery-3.5.1.js"></script>-->
<script src="/js/bootstrap.min.js"></script>
</body>
</html>